$(document).ready(function() {
	$("#sect_ch_mobilecode_g").click(function(){
		var mobile=$("#mobile").val();
		var validataMobile=Helper.validata.validataMobile(mobile);
		if(validataMobile){
			Helper.message(validataMobile);
			return ;
		}
		var sendRegValidSMS = new Helper.RemoteTrans({
			url:Helper.basePath+"/sendBackPassValidSMS.htm",
			onSuccess:function(json) {
				if(json.isSuccess==true){
					var timeInterval=json.returnValue;
					$("#sect_ch_mobilecode_g").hide();
					$("#sect_ch_mobilecode_h").show();
					var timmer=new Helper.Timmer({
						milli:1000,
						count:timeInterval,
						call:function(){
							timeInterval=timeInterval-1;
							if( timeInterval> 0) {
								$("#sect_ch_mobilecode_h").val(timeInterval+"秒后可重发");
							}else{
								$("#sect_ch_mobilecode_g").show();
								$("#sect_ch_mobilecode_h").hide();
							}
						}
					});
					Helper.message("短信发送成功，请注意查收！");
					timmer.start();
				}else{
					Helper.message(json.message);
				}
			},
			onError:function(json){
				Helper.message(json.message);
			}
		});
		sendRegValidSMS.params = {mobile:mobile};
		sendRegValidSMS.send();
	});
	/**
	 * 提交
	 */
	$("#subfrm").click(function(){
		var email = $("#email").val();
		var validataEmail = Helper.validata.validataEmail(email);
		if(validataEmail) {
			Helper.message(validataEmail);
			return;
		}
		$("#r_email").val(email);
		$("#recoverForm").submit();
	});
	/**
	 * 提交
	 */
	$("#subfrm_next").click(function(){
		var password=$("#password").val();
		var password_re=$("#password_re").val();
		var validataPass=Helper.validata.validataPass(password);
		if(validataPass){
			Helper.message(validataPass);
			return;
		}
		if(password!=password_re){
			Helper.message("密码不一致");
			return;
		}
		$("#signup").submit();
	});
	
	
});